Quản lý website giới thiệu và bán điện thoại di động ASP.net
19.327 lượt xem;
- themqtri.aspx.cs
- project /
1 using System;
2 using System.Data;
3 using System.Configuration;
4 using System.Collections;
5 using System.Web;
6 using System.Web.Security;
7 using System.Web.UI;
8 using System.Web.UI.WebControls;
9 using System.Web.UI.WebControls.WebParts;
10 using System.Web.UI.HtmlControls;
11 using System.Data.OleDb;
12 public partial class Default3 : System.Web.UI.Page
13 {
14 OleDbConnection con;
15 OleDbCommand cm;
16 protected void Page_Load(object sender, EventArgs e)
17 {
18
19 }
20 protected void btndangky_Click(object sender, EventArgs e)
21 {
22 if (txtemail.Text != "")
23 {
24 if ((txtemail.Text.LastIndexOf("@") != -1)&&(txtemail.Text.LastIndexOf("."))!=-1)
25 {
26
27 if (txtpass.Text != "")
28 {
29 if (txtpass.Text == TextBox3.Text)
30 {
31 con = new OleDbConnection();
32 con.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["MyDBConnectionString"].ToString();
33 con.Open();
34 cm = new OleDbCommand("insert into tbluser values ('" + txtemail.Text + "','" + txtpass.Text + "','admin','" + txthoteb.Text + "','" + txtdc.Text + "','" + txtdt.Text + "','" + txtcmt.Text + "','" + txtnganhang.Text + "','" + txtmabuudien.Text + "')", con);
35 cm.ExecuteNonQuery();
36 cm.Dispose();
37 con.Close();
38 Lblthongbao.Text = "Bạn đã đăng ký thành công ";
39 }
40 else Lblthongbao.Text = "Xác nhận mật khẩu chưa đúng";
41
42 }
43 else Lblthongbao.Text = "Bạn chưa nhập vào mật khẩu";
44 }
45 else Lblthongbao.Text = "Email nhập chưa đúng";
46 }
47 else Lblthongbao.Text = "Bạn chưa nhập Email";
48 }
49 }
2 using System.Data;
3 using System.Configuration;
4 using System.Collections;
5 using System.Web;
6 using System.Web.Security;
7 using System.Web.UI;
8 using System.Web.UI.WebControls;
9 using System.Web.UI.WebControls.WebParts;
10 using System.Web.UI.HtmlControls;
11 using System.Data.OleDb;
12 public partial class Default3 : System.Web.UI.Page
13 {
14 OleDbConnection con;
15 OleDbCommand cm;
16 protected void Page_Load(object sender, EventArgs e)
17 {
18
19 }
20 protected void btndangky_Click(object sender, EventArgs e)
21 {
22 if (txtemail.Text != "")
23 {
24 if ((txtemail.Text.LastIndexOf("@") != -1)&&(txtemail.Text.LastIndexOf("."))!=-1)
25 {
26
27 if (txtpass.Text != "")
28 {
29 if (txtpass.Text == TextBox3.Text)
30 {
31 con = new OleDbConnection();
32 con.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["MyDBConnectionString"].ToString();
33 con.Open();
34 cm = new OleDbCommand("insert into tbluser values ('" + txtemail.Text + "','" + txtpass.Text + "','admin','" + txthoteb.Text + "','" + txtdc.Text + "','" + txtdt.Text + "','" + txtcmt.Text + "','" + txtnganhang.Text + "','" + txtmabuudien.Text + "')", con);
35 cm.ExecuteNonQuery();
36 cm.Dispose();
37 con.Close();
38 Lblthongbao.Text = "Bạn đã đăng ký thành công ";
39 }
40 else Lblthongbao.Text = "Xác nhận mật khẩu chưa đúng";
41
42 }
43 else Lblthongbao.Text = "Bạn chưa nhập vào mật khẩu";
44 }
45 else Lblthongbao.Text = "Email nhập chưa đúng";
46 }
47 else Lblthongbao.Text = "Bạn chưa nhập Email";
48 }
49 }